package com.gg.util;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
/**
 * DefaultConsumer 写法  spring2.x
 * @author Administrator
 *
 */
public class MyConsumer extends DefaultConsumer {
	 

	public MyConsumer(Channel channel) {
		
		super(channel);
	}
	@Override
	public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) {
		System.out.println("-----------我是消费者  consume message----------");
        System.out.println("consumerTag: " + consumerTag);
        System.out.println("envelope: " + envelope);
        System.out.println("properties: " + properties);
        System.out.println("body: " + new String(body));
	}

}
